package com.bh.weapp.controller.sysuser.order;

import com.bh.common.core.controller.BaseController;
import com.bh.common.core.domain.AjaxResult;
import com.bh.common.core.page.TableDataInfo;
import com.bh.order.domain.JcOrderArrive;
import com.bh.order.service.IJcOrderArriveService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 货品到站记录Controller
 *
 * @author slx
 * @date 2023-04-22
 */
@Api(tags = {"SYS货品到站记录Api"})
@RestController
@RequestMapping("/api/sysuser/order/orderArrive")
public class JcOrderArriveSysApiController extends BaseController {

    @Autowired
    private IJcOrderArriveService jcOrderArriveService;

    /**
     * 查询货品到站记录列表
     */
    @ApiOperation("查询货品到站记录列表")
    @PreAuthorize("@ss.hasPermi('api:order:orderArrive:list')")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody JcOrderArrive jcOrderArrive) {
        startPage();
        List<JcOrderArrive> list = jcOrderArriveService.selectJcOrderArriveList(jcOrderArrive);
        return getDataTable(list);
    }

    /**
     * 修改货品到站记录
     */
    @ApiOperation("查询货品到站记录")
    @PreAuthorize("@ss.hasPermi('api:order:orderArrive:info')")
    @GetMapping("/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        JcOrderArrive jcOrderArrive = jcOrderArriveService.selectJcOrderArriveById(id);
        return AjaxResult.success(jcOrderArrive);
    }
}
